package com.company.mtp.test.engine.api;

import java.io.Serializable;
import java.util.Map;

/**
 * 测试引擎状态实体类
 * 
 * @author mtp
 */
public class EngineStatus implements Serializable {
    
    private static final long serialVersionUID = 1L;

    /** 引擎ID */
    private String engineId;
    
    /** 引擎名称 */
    private String engineName;
    
    /** 引擎类型 */
    private String engineType;
    
    /** 引擎版本 */
    private String engineVersion;
    
    /** 运行状态 */
    private Status status;
    
    /** 启动时间 */
    private Long startTime;
    
    /** 最后活动时间 */
    private Long lastActiveTime;
    
    /** 当前执行的测试ID */
    private String currentTestId;
    
    /** 已执行测试数量 */
    private int executedTests;
    
    /** 成功测试数量 */
    private int successfulTests;
    
    /** 失败测试数量 */
    private int failedTests;
    
    /** 错误测试数量 */
    private int errorTests;
    
    /** 资源使用情况 */
    private ResourceUsage resourceUsage;
    
    /** 引擎配置 */
    private Map<String, Object> configuration;
    
    /** 引擎能力 */
    private Map<String, Object> capabilities;
    
    /** 错误信息 */
    private String errorMessage;

    /**
     * 引擎状态枚举
     */
    public enum Status {
        /** 未初始化 */
        NOT_INITIALIZED,
        
        /** 初始化中 */
        INITIALIZING,
        
        /** 就绪 */
        READY,
        
        /** 运行中 */
        RUNNING,
        
        /** 暂停 */
        PAUSED,
        
        /** 错误 */
        ERROR,
        
        /** 关闭中 */
        SHUTTING_DOWN,
        
        /** 已关闭 */
        SHUTDOWN
    }

    /**
     * 资源使用情况内部类
     */
    public static class ResourceUsage implements Serializable {
        
        private static final long serialVersionUID = 1L;
        
        /** CPU使用率(%) */
        private double cpuUsage;
        
        /** 内存使用(MB) */
        private double memoryUsage;
        
        /** 磁盘使用(MB) */
        private double diskUsage;
        
        /** 网络使用(KB/s) */
        private double networkUsage;
        
        /** 线程数 */
        private int threadCount;

        // Getters and Setters
        
        public double getCpuUsage() {
            return cpuUsage;
        }

        public void setCpuUsage(double cpuUsage) {
            this.cpuUsage = cpuUsage;
        }

        public double getMemoryUsage() {
            return memoryUsage;
        }

        public void setMemoryUsage(double memoryUsage) {
            this.memoryUsage = memoryUsage;
        }

        public double getDiskUsage() {
            return diskUsage;
        }

        public void setDiskUsage(double diskUsage) {
            this.diskUsage = diskUsage;
        }

        public double getNetworkUsage() {
            return networkUsage;
        }

        public void setNetworkUsage(double networkUsage) {
            this.networkUsage = networkUsage;
        }

        public int getThreadCount() {
            return threadCount;
        }

        public void setThreadCount(int threadCount) {
            this.threadCount = threadCount;
        }
    }

    // Getters and Setters
    
    public String getEngineId() {
        return engineId;
    }

    public void setEngineId(String engineId) {
        this.engineId = engineId;
    }

    public String getEngineName() {
        return engineName;
    }

    public void setEngineName(String engineName) {
        this.engineName = engineName;
    }

    public String getEngineType() {
        return engineType;
    }

    public void setEngineType(String engineType) {
        this.engineType = engineType;
    }

    public String getEngineVersion() {
        return engineVersion;
    }

    public void setEngineVersion(String engineVersion) {
        this.engineVersion = engineVersion;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public Long getStartTime() {
        return startTime;
    }

    public void setStartTime(Long startTime) {
        this.startTime = startTime;
    }

    public Long getLastActiveTime() {
        return lastActiveTime;
    }

    public void setLastActiveTime(Long lastActiveTime) {
        this.lastActiveTime = lastActiveTime;
    }

    public String getCurrentTestId() {
        return currentTestId;
    }

    public void setCurrentTestId(String currentTestId) {
        this.currentTestId = currentTestId;
    }

    public int getExecutedTests() {
        return executedTests;
    }

    public void setExecutedTests(int executedTests) {
        this.executedTests = executedTests;
    }

    public int getSuccessfulTests() {
        return successfulTests;
    }

    public void setSuccessfulTests(int successfulTests) {
        this.successfulTests = successfulTests;
    }

    public int getFailedTests() {
        return failedTests;
    }

    public void setFailedTests(int failedTests) {
        this.failedTests = failedTests;
    }

    public int getErrorTests() {
        return errorTests;
    }

    public void setErrorTests(int errorTests) {
        this.errorTests = errorTests;
    }

    public ResourceUsage getResourceUsage() {
        return resourceUsage;
    }

    public void setResourceUsage(ResourceUsage resourceUsage) {
        this.resourceUsage = resourceUsage;
    }

    public Map<String, Object> getConfiguration() {
        return configuration;
    }

    public void setConfiguration(Map<String, Object> configuration) {
        this.configuration = configuration;
    }

    public Map<String, Object> getCapabilities() {
        return capabilities;
    }

    public void setCapabilities(Map<String, Object> capabilities) {
        this.capabilities = capabilities;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }
}